﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MM.Commmon.UI
{
    public partial class FrmLoading : Form
    {
        private bool _CurrentlyAnimating;
        public FrmLoading()
        {
            InitializeComponent();
            this.label1.ForeColor = Color.FromArgb(30, 0x30, 60);
        }

        private void OnFrameChanged(object o, EventArgs e)
        {
            this.pictureBox1.Invalidate();
        }

        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            if (!this._CurrentlyAnimating)
            {
                ImageAnimator.Animate(this.pictureBox1.Image, new EventHandler(this.OnFrameChanged));
                this._CurrentlyAnimating = true;
            }
        }
    }
}
